using System;
using System.Collections.Generic;
using System.Text;

using PickGold;
using PickGold.Database;
using PickGold.Entities.Table;

namespace PickGold.Entities.View
{
    public class CViewEventInfo : CBaseView
    {
        //
        public const string ENTITY_NAME = "vw_sys_event_info";
        public const string ENTITY_ALIAS = "events";
        // tb_log_event_info
		public const string USER_ID = CBaseUserInfo.ENTITY_KEY;
		public const string ITEM_IP = "item_ip";
		public const string ITEM_CODE = "item_code";
		public const string ITEM_LEVEL = "item_level";
		public const string ITEM_TITLE = "item_title";
		public const string ITEM_MODEL = "item_model";
		public const string ITEM_VALUE = "item_value";
		//
        public const string USER_NAME = CBaseUserInfo.ENTITY_SYMBOL;
        //
        private SViewEventInfo _ = null;
        //
        public CViewEventInfo() : base(ENTITY_NAME, ENTITY_ALIAS) { }
        public CViewEventInfo(CDatabase db) : base(db, ENTITY_NAME, ENTITY_ALIAS) { }
        public CViewEventInfo(string alias) : base(ENTITY_NAME, alias) { }
		public CViewEventInfo(CDatabase db, string alias) : base(db, ENTITY_NAME, alias) { }
        //
        protected override void SetSchema()
        {
			this.SetSchema(new SViewEventInfo());
        }
		protected void SetSchema(SViewEventInfo s)
        {
            this._ = s;
            base.SetSchema(s);
        }
        //
        protected override void PreInitSchema()
        {
            base.PreInitSchema();
			// tb_log_event_info
			this._DataTable.Columns.Add(USER_ID, typeof(long)).DefaultValue = this._.UserID;
			this._DataTable.Columns.Add(ITEM_IP, typeof(long)).DefaultValue = this._.ItemIP;
			this._DataTable.Columns.Add(ITEM_CODE, typeof(string)).MaxLength = 50;
			this._DataTable.Columns.Add(ITEM_LEVEL, typeof(long)).DefaultValue = this._.ItemLevel;
			this._DataTable.Columns.Add(ITEM_TITLE, typeof(string)).MaxLength = 50;
			this._DataTable.Columns.Add(ITEM_MODEL, typeof(string)).MaxLength = 256;
			this._DataTable.Columns.Add(ITEM_VALUE, typeof(string)).MaxLength = 1024;
		}
        //
        #region Property
		//
		#region tb_log_event_info
		//
		public long UserID
		{
			set
			{
				this._.UserID = value;
				this.SetValue(USER_ID, value);
			}
			get
			{
				return this._.UserID;
			}
		}
		//
		public long ItemIP
		{
			set
			{
				this._.ItemIP = value;
				this.SetValue(ITEM_IP, value);
			}
			get
			{
				return this._.ItemIP;
			}
		}
		//
		public string ItemCode
		{
			set
			{
				this._.ItemCode = value;
				this.SetValue(ITEM_CODE, value);
			}
			get
			{
				return this._.ItemCode;
			}
		}
		//
		public long ItemLevel
		{
			set
			{
				this._.ItemLevel = value;
				this.SetValue(ITEM_LEVEL, value);
			}
			get
			{
				return this._.ItemLevel;
			}
		}
		//
		public string ItemTitle
		{
			set
			{
				this._.ItemTitle = value;
				this.SetValue(ITEM_TITLE, value);
			}
			get
			{
				return this._.ItemTitle;
			}
		}
		//
		public string ItemModel
		{
			set
			{
				this._.ItemModel = value;
				this.SetValue(ITEM_MODEL, value);
			}
			get
			{
				return this._.ItemModel;
			}
		}
		//
		public string ItemValue
		{
			set
			{
				this._.ItemValue = value;
				this.SetValue(ITEM_VALUE, value);
			}
			get
			{
				return this._.ItemValue;
			}
		}
		//
		#endregion
        //
        #endregion
        //
        public override bool MoveTo(int position)
        {
            if (!base.MoveTo(position))
                return false;
			// tb_log_event_info
			this._.UserID = this.GetValue<long>(USER_ID);
			this._.ItemIP = this.GetValue<long>(ITEM_IP);
			this._.ItemCode = this.GetValue<string>(ITEM_CODE);
			this._.ItemLevel = this.GetValue<long>(ITEM_LEVEL);
			this._.ItemTitle = this.GetValue<string>(ITEM_TITLE);
			this._.ItemModel = this.GetValue<string>(ITEM_MODEL);
			this._.ItemValue = this.GetValue<string>(ITEM_VALUE);
			//
            return true;
        }
        //
    }
    //
	public class SViewEventInfo : SBaseView
    {
        // tb_log_event_info
		public long UserID = -1;
		public long ItemIP = -1;
		public string ItemCode = null;
		public long ItemLevel = 0;
		public string ItemTitle = null;
		public string ItemModel = null;
		public string ItemValue = null;
		//
    }
    //
}
//
